home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / fputs.c < prev    next >
C/C++ Source or Header  |  1989-08-13  |  493b  |  34 lines

  1. /* from Dale Schumacher's dLibs */
  2.  
  3. #include <stdio.h>
  4. #include <stddef.h>
  5. #include <assert.h>
  6.  
  7. int fputs(data, fp)
  8.     const register char *data;
  9.     register FILE *fp;
  10.     {
  11.     register int n = 0;
  12.     
  13.     assert((data != NULL));
  14.     while(*data)
  15.         {
  16.         if(fputc(*data++, fp) == EOF)
  17.             return(EOF);
  18.         ++n;
  19.         }
  20.     return(n);
  21.     }
  22.  
  23. int puts(data)
  24.     const char *data;
  25.     {
  26.     register int n;
  27.  
  28.     assert((data != NULL));
  29.     if(((n = fputs(data, stdout)) == EOF)
  30.     || (fputc('\n', stdout) == EOF))
  31.         return(EOF);
  32.     return(++n);
  33.     }
  34.